<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\meituan\controller;

use app\meituan\model\MeituanOrderModel;
use app\meituan\service\MeituanOrderImportService;
use cmf\controller\AdminBaseController;

class AdminGoodsController extends AdminBaseController
{
    public function list()
    {
        $param = $this->request->param();
        $meituanOrder = new MeituanOrderModel();
        $articles = $meituanOrder
//            ->field($field)
//            ->where('a.create_time', '>=', 0)
//            ->where('a.delete_time', 0)
//            ->where('a.post_status', 1)
//            ->where(function (Query $query) use ($filter, $isPage) {
//                if (!empty($filter['user_id'])) {
//                    $query->where('a.user_id', $filter['user_id']);
//                }
//                $category = empty($filter['category_id']) ? 0 : intval($filter['category_id']);
//                if (!empty($category)) {
//                    $query->where('b.category_id', $category);
//                }
//                $startTime = empty($filter['start_time']) ? 0 : strtotime($filter['start_time']);
//                $endTime   = empty($filter['end_time']) ? 0 : strtotime($filter['end_time']);
//                if (!empty($startTime)) {
//                    $query->where('a.published_time', '>=', $startTime);
//                }
//                if (!empty($endTime)) {
//                    $query->where('a.published_time', '<=', $endTime);
//                }
//                $keyword = empty($filter['keyword']) ? '' : $filter['keyword'];
//                if (!empty($keyword)) {
//                    $query->where('a.post_title', 'like', "%$keyword%");
//                }
//                if ($isPage) {
//                    $query->where('a.post_type', 2);
//                } else {
//                    $query->where('a.post_type', 1);
//                }
//                if (!empty($filter['recommended'])) {
//                    $query->where('a.recommended', 1);
//                }
//                if (!empty($filter['ids'])) {
//                    $ids = str_to_arr($filter['ids']);
//                    $query->where('a.id', 'in', $ids);
//                }
//            })
//            ->order()
            ->select()->toArray();
        echo "<pre/>";
        print_r($articles);
        die();
        return $this->fetch();
    }



}
